//


#import "AM_DeleteHirstoryTableViewCell.h"

//
@interface AM_DeleteHirstoryTableViewCell ()
/** name*/
@property (nonatomic, strong) UILabel *nameLabel;
/** 帐号*/
@property (nonatomic, strong) UILabel *accountLabel;
/** s日期*/
@property (nonatomic, strong) UILabel *dateLabel;

@end

@implementation AM_DeleteHirstoryTableViewCell

// 初始化cell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self createTableViewCell];
    }
    return self;
}

// 初始化
-(void)createTableViewCell {
    ///
    self.nameLabel = ({
        UILabel *label = [[UILabel alloc]init];
        label.textColor = rgba(90, 90, 90, 1);
        label.font = FontPFRegular(kRelativeWidth(15));
        label.text = @"";
        [self.contentView addSubview:label];
        label;
    });
    self.accountLabel = ({
        UILabel *label = [[UILabel alloc]init];
        label.textColor = rgba(90, 90, 90, 1);
        label.font = FontPFRegular(kRelativeWidth(15));
        label.text = @"";
        [self.contentView addSubview:label];
        label;
    });
    self.dateLabel = ({
        UILabel *label = [[UILabel alloc]init];
        label.textColor = rgba(90, 90, 90, 1);
        label.font = FontPFRegular(kRelativeWidth(15));
        label.text = @"";
        [self.contentView addSubview:label];
        label;
    });
    
}

- (void)setNeedsLayout {
    [super setNeedsLayout];
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_offset(kRelativeHeight(15));
        make.left.mas_offset(kRelativeWidth(12));
        make.height.mas_equalTo(kRelativeHeight(20));
    }];
    //
    [self.accountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_offset(kRelativeHeight(15));
        make.left.mas_equalTo(self.nameLabel.mas_right).offset(kRelativeWidth(12));
        make.height.mas_equalTo(kRelativeHeight(20));
    }];
    [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.nameLabel);
        make.right.mas_offset(-kRelativeWidth(12));
        make.height.mas_equalTo(kRelativeHeight(20));
    }];
    
}

- (void)setModel:(DeleteData *)model {
    self.nameLabel.text = model.name;
    self.accountLabel.text = model.account;
    self.dateLabel.text = model.date;
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
